/**
 * Created by lghdb on 2018/7/10.
 */

module.exports = async (ctx, next) => {
    console.log(`ctx.session.loginUser == ${ctx.session.loginUser}`)
    if (ctx.path != '/login' && !ctx.session.loginUser){
        ctx.response.redirect('/login');
    }else{
        await next();
    }
}